from django.http import HttpResponse
from django.core.cache import cache
from django.core.cache.backends.memcached import MemcachedCache

def index(request):
    cache.set('password','zhiliao',100)
    username = cache.get('username')
    print(username)
    return HttpResponse(username)